﻿
namespace TeamCommunitySolution.Domain.Extensions
{
    /// <summary>
    /// Rule violation.
    /// </summary>
    public class RuleViolation
    {
        /// <summary>
        /// Internal holder.
        /// </summary>
        public string ErrorMessage { get; private set; }

        /// <summary>
        /// Internal holder.
        /// </summary>
        public string PropertyName { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="RuleViolation"/> class.
        /// </summary>
        /// <param name="errorMessage">The error message.</param>
        public RuleViolation(string errorMessage)
        {
            ErrorMessage = errorMessage;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RuleViolation"/> class.
        /// </summary>
        /// <param name="errorMessage">The error message.</param>
        /// <param name="propertyName">Name of the property.</param>
        public RuleViolation(string errorMessage, string propertyName)
        {
            ErrorMessage = errorMessage;
            PropertyName = propertyName;
        }
    }
}
